package com.google.denta.dao.ibatis;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.google.denta.dao.PersonDao;
import com.google.denta.entity.Person;

/**
 * UserSqlMapDao.
 * @see SqlMapClientDaoSupport
 * @see UserDao
 */
public class PersonSqlMapDao extends SqlMapClientDaoSupport implements
        PersonDao {

    /** {@inheritDoc} */
    public Long create(final Person person) {
        return (Long) getSqlMapClientTemplate().insert("Person.create", person);
    }

    /** {@inheritDoc} */
    public Person read(final Long id) {
        return (Person) getSqlMapClientTemplate().queryForObject("Person.read",
                id);
    }

    /** {@inheritDoc} */
    public void update(final Person person) {
        getSqlMapClientTemplate().update("Person.update", person);
    }

    /** {@inheritDoc} */
    public void delete(final Long id) {
        getSqlMapClientTemplate().delete("Person.delete", id);
    }

}
